// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
require('es6-promise').polyfill()
import Vue from 'vue'
import FastClick from 'fastclick'
import store from '@/vuex'
import App from './App'
import { Toast } from 'vant';
// Vue.use(Toast)
import { LoadingPlugin } from 'vux'
Vue.use(LoadingPlugin)

import router from './router'
import * as filters from './filters' // 全局filter
import {TransferDom } from 'vux'
Vue.directive('TransferDom', TransferDom);
import NativePlugin from './plugin/native'
import 'lib-flexible/flexible'
import BusPlugin from './plugin/bus/index.js'

FastClick.attach(document.body)
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})
Vue.use(NativePlugin);
import { Lazyload } from 'vant';
Vue.use(Lazyload, {
  preLoad: 1.3,
  attempt: 1
})
import BaiduMap from 'vue-baidu-map';
Vue.use(BaiduMap, {
  /* Visit http://lbsyun.baidu.com/apiconsole/key for details about app key. */
  ak: 'X6vwid0jQvhDIKifZVlqB4ROfYySbQRq'
})
Vue.use(BusPlugin)

if(process.env.NODE_ENV === 'production') {
    console.log = function() {}
    console.warn = function() {}
    Vue.config.productionTip = false
    Vue.config.devtools = false;
}
/* eslint-disable no-new */
new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app-box')
